<template>
  <div>购物车</div>
</template>
<script>
export default {
  name: "ShopCar",
  data() {
    return {};
  },
  // 组件内路由守卫
  beforeRouteEnter(to, form, next) {
    let token = window.localStorage.getItem("token");
    if (!token) {
      next({
        path: "/"
      });
      
      alert("请登录");
    }
    next();
  }
};
</script>
<style scoped>
</style>